package com.gk.panda;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.oas.annotations.EnableOpenApi;

/**
 * @Description:
 * @author: wangchao74
 * @date: 2023/12/15 16:08
 * @version: 1.0
 **/
@SpringBootApplication
@EnableTransactionManagement//开启声明式事务
@EnableOpenApi
@MapperScan("com.gk.panda.camera.mapper")
@EnableScheduling
public class PandaCameraApp {
    private static final Logger logger = LoggerFactory.getLogger(PandaCameraApp.class);
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(PandaCameraApp.class,args);
        ConfigurableEnvironment environment = applicationContext.getEnvironment();
        String serverPort = environment.getProperty("server.port");
        String url = "http://127.0.0.1:" + serverPort + "/doc.html";
        logger.info("项目启动成功，swagger访问地址是：{}", url);
    }
}
